
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
create view [dbo].[tab_cargo] as
 SELECT	distinct idCargoSARH as tab_cargo_id, --idCargo as tab_cargo_id,
		cargo as tab_cargo_desc,
		case when idCargo = 431 then 1 else p.tipodefuncion end as cte_tipo_cargo,
		puntos as tab_cargo_puntaje,
		equivhoraria as equivalencia_horas,
		e.mnemo as tab_cargo_asig_presup,
		c.esDirectivo as tab_cargo_directivo
FROM tb_cargosSalariales as c left join tb_plazas p on c.idcargo = p.CargoSalarialDefault ,
tb_escalafones e
where c.escalafon = e.idescalafon 
GO
